﻿using Lcygcc.Infrastructure.Utility.IOC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using Lcygcc.Infrastructure.Core;
using Lcygcc.Domain.TaskServiceAdapter;
using Lcygcc.Domain.TaskService.SyncToJKClound;
using Lcygcc.Domain.Common;

namespace Lcygcc.Domain.TaskService
{
    public class DependencyRegistrar : IDependencyRegistrar
    {
        public int Order
        {
            get
            {
                return 1;
            }
        }

        public void Register(ContainerBuilder builder, ITypeFinder typeFinder)
        {
            builder.RegisterType<AutoTaskThread>().As<IAutoTaskThread>();
            builder.RegisterType<BaseTaskService>().As<IBaseTaskService>();
            builder.RegisterType<SyncPersonAdapter>().As<ITaskWork>().Named<ITaskWork>("SyncPersonAdapter");
            builder.RegisterType<JKCloudChannel>().As<IBaseChannel>().Named<IBaseChannel>("JKCloudChannel");
            builder.RegisterType<QueryCardSeriesAdapter>().As<ITaskWork>().Named<ITaskWork>(enumServiceID.queryCardSeriesList.ToString());
            builder.RegisterType<QueryCardTypeAdapter>().As<ITaskWork>().Named<ITaskWork>(enumServiceID.queryCardTypeList.ToString());
            builder.RegisterType<ClearDataAdapter>().As<ITaskWork>().Named<ITaskWork>(enumServiceID.clearData.ToString());
        }
    }
}
